import { getRoutersProps } from "@/hooks/use-routers-props.js";
import Layout from "@/layout";

const routers = [
  {
    path: "/",
    name:'dashboard',
    component: (resolve) =>
          require(["@/views/dashboard/index.vue"], resolve),
    // component: Layout,
    // hidden: true,
    // children: [
    //   {
    //     path: "/dashboard",
    //     name: "dashboard",
    //     component: (resolve) =>
    //       require(["@/views/dashboard/index.vue"], resolve),
    //     meta: { title: "首页", noCache: true },
    //   },
    // ],
  },
  // 字典管理
  {
    path: "/system/dict",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/system/dict/dictData",
        name: "DictDataList",
        component: (resolve) =>
          require(["@/views/xy/system/dict/DictData.vue"], resolve),
        meta: { title: "字典数据", noCache: true },
      },
    ],
  },
  // 城市体检详情
  {
    path: "/public/cityAnalysis/cityDetail",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/public/cityAnalysis/cityDetailDetail",
        // name: "cityDetailDetail",
        // 新打开页面面包屑会显示name字段内容
        name:"监测分析 / 分析诊断管理 / 城市详情信息",
        component: (resolve) =>
          require(["@/views/xy/public/cityAnalysis/cityDetail/detailIndex.vue"], resolve),
        meta: { title: "城市详情信息", noCache: true },
      },
    ],
  },
  // 共性问题信息详情
  {
    path: "/public/cityAnalysis/overview/publicProbleDetail",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/public/cityAnalysis/overview/publicProbleDetail",
        // name: "cityDetailDetail",
        // 新打开页面面包屑会显示name字段内容
        name:"城市体检 / 分析诊断管理 / 分析诊断总览 / 共性问题信息详情",
        component: (resolve) =>
          require(["@/views/xy/public/cityAnalysis/overview/components/publicProblemDetail.vue"], resolve),
        meta: { title: "共性问题信息详情", noCache: true },
      },
    ],
  },

  // 代码生成
  {
    path: "/gen",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/gen/detailIndex",
        name: "genDetailIndex",
        component: (resolve) =>
          require([
            "@/views/xy/gen/generate2/components/detailIndex.vue",
          ], resolve),
        meta: { title: "生成信息", noCache: true },
      },
    ],
  },

  // 示例 example
  {
    path: "/example",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/example/",
        name: "Example",
        component: (resolve) => require(["@/views/example/index.vue"], resolve),
        meta: { title: "示例", noCache: true },
      },
    ],
  },

  // 测试用的 审批详情页
  {
    path: "/demos/",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/demos/activitiInfo",
        name: "ActivitiInfo",

        component: (resolve) =>
          require(["@/views/demos/activitiInfo/ActivitiInfo.vue"], resolve),

        meta: { title: "测试用的-审批详情页-标题", noCache: true },

        // https://v3.router.vuejs.org/zh/guide/advanced/navigation-guards.html#路由独享的守卫
        // beforeEnter: (to, from, next) => {
        //   // this.
        // },

        props: (route) => {
          return getRoutersProps(route, [
            "instanceId",
            "businessKey",
            "taskId",
          ]);
        },
      },
    ],
  },
];

export default routers;
